import 'package:flutter_base/generated/json/base/json_convert_content.dart';
import 'package:flutter_base/bean/mine/check_app_update_entity.dart';

CheckAppUpdateEntity $CheckAppUpdateEntityFromJson(Map<String, dynamic> json) {
  final CheckAppUpdateEntity checkAppUpdateEntity = CheckAppUpdateEntity();
  final int? code = jsonConvert.convert<int>(json['code']);
  if (code != null) {
    checkAppUpdateEntity.code = code;
  }
  final String? message = jsonConvert.convert<String>(json['message']);
  if (message != null) {
    checkAppUpdateEntity.message = message;
  }
  final CheckAppUpdateData? data = jsonConvert.convert<CheckAppUpdateData>(
      json['data']);
  if (data != null) {
    checkAppUpdateEntity.data = data;
  }
  return checkAppUpdateEntity;
}

Map<String, dynamic> $CheckAppUpdateEntityToJson(CheckAppUpdateEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['code'] = entity.code;
  data['message'] = entity.message;
  data['data'] = entity.data.toJson();
  return data;
}

extension CheckAppUpdateEntityExtension on CheckAppUpdateEntity {
  CheckAppUpdateEntity copyWith({
    int? code,
    String? message,
    CheckAppUpdateData? data,
  }) {
    return CheckAppUpdateEntity()
      ..code = code ?? this.code
      ..message = message ?? this.message
      ..data = data ?? this.data;
  }
}

CheckAppUpdateData $CheckAppUpdateDataFromJson(Map<String, dynamic> json) {
  final CheckAppUpdateData checkAppUpdateData = CheckAppUpdateData();
  final String? buildBuildVersion = jsonConvert.convert<String>(
      json['buildBuildVersion']);
  if (buildBuildVersion != null) {
    checkAppUpdateData.buildBuildVersion = buildBuildVersion;
  }
  final String? forceUpdateVersion = jsonConvert.convert<String>(
      json['forceUpdateVersion']);
  if (forceUpdateVersion != null) {
    checkAppUpdateData.forceUpdateVersion = forceUpdateVersion;
  }
  final String? forceUpdateVersionNo = jsonConvert.convert<String>(
      json['forceUpdateVersionNo']);
  if (forceUpdateVersionNo != null) {
    checkAppUpdateData.forceUpdateVersionNo = forceUpdateVersionNo;
  }
  final bool? needForceUpdate = jsonConvert.convert<bool>(
      json['needForceUpdate']);
  if (needForceUpdate != null) {
    checkAppUpdateData.needForceUpdate = needForceUpdate;
  }
  final String? downloadURL = jsonConvert.convert<String>(json['downloadURL']);
  if (downloadURL != null) {
    checkAppUpdateData.downloadURL = downloadURL;
  }
  final bool? buildHaveNewVersion = jsonConvert.convert<bool>(
      json['buildHaveNewVersion']);
  if (buildHaveNewVersion != null) {
    checkAppUpdateData.buildHaveNewVersion = buildHaveNewVersion;
  }
  final String? buildVersionNo = jsonConvert.convert<String>(
      json['buildVersionNo']);
  if (buildVersionNo != null) {
    checkAppUpdateData.buildVersionNo = buildVersionNo;
  }
  final String? buildVersion = jsonConvert.convert<String>(
      json['buildVersion']);
  if (buildVersion != null) {
    checkAppUpdateData.buildVersion = buildVersion;
  }
  final String? buildDescription = jsonConvert.convert<String>(
      json['buildDescription']);
  if (buildDescription != null) {
    checkAppUpdateData.buildDescription = buildDescription;
  }
  final String? buildUpdateDescription = jsonConvert.convert<String>(
      json['buildUpdateDescription']);
  if (buildUpdateDescription != null) {
    checkAppUpdateData.buildUpdateDescription = buildUpdateDescription;
  }
  final String? appURl = jsonConvert.convert<String>(json['appURl']);
  if (appURl != null) {
    checkAppUpdateData.appURl = appURl;
  }
  final String? appKey = jsonConvert.convert<String>(json['appKey']);
  if (appKey != null) {
    checkAppUpdateData.appKey = appKey;
  }
  final String? buildKey = jsonConvert.convert<String>(json['buildKey']);
  if (buildKey != null) {
    checkAppUpdateData.buildKey = buildKey;
  }
  final String? buildName = jsonConvert.convert<String>(json['buildName']);
  if (buildName != null) {
    checkAppUpdateData.buildName = buildName;
  }
  final String? buildIcon = jsonConvert.convert<String>(json['buildIcon']);
  if (buildIcon != null) {
    checkAppUpdateData.buildIcon = buildIcon;
  }
  final String? buildFileKey = jsonConvert.convert<String>(
      json['buildFileKey']);
  if (buildFileKey != null) {
    checkAppUpdateData.buildFileKey = buildFileKey;
  }
  final String? buildFileSize = jsonConvert.convert<String>(
      json['buildFileSize']);
  if (buildFileSize != null) {
    checkAppUpdateData.buildFileSize = buildFileSize;
  }
  return checkAppUpdateData;
}

Map<String, dynamic> $CheckAppUpdateDataToJson(CheckAppUpdateData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['buildBuildVersion'] = entity.buildBuildVersion;
  data['forceUpdateVersion'] = entity.forceUpdateVersion;
  data['forceUpdateVersionNo'] = entity.forceUpdateVersionNo;
  data['needForceUpdate'] = entity.needForceUpdate;
  data['downloadURL'] = entity.downloadURL;
  data['buildHaveNewVersion'] = entity.buildHaveNewVersion;
  data['buildVersionNo'] = entity.buildVersionNo;
  data['buildVersion'] = entity.buildVersion;
  data['buildDescription'] = entity.buildDescription;
  data['buildUpdateDescription'] = entity.buildUpdateDescription;
  data['appURl'] = entity.appURl;
  data['appKey'] = entity.appKey;
  data['buildKey'] = entity.buildKey;
  data['buildName'] = entity.buildName;
  data['buildIcon'] = entity.buildIcon;
  data['buildFileKey'] = entity.buildFileKey;
  data['buildFileSize'] = entity.buildFileSize;
  return data;
}

extension CheckAppUpdateDataExtension on CheckAppUpdateData {
  CheckAppUpdateData copyWith({
    String? buildBuildVersion,
    String? forceUpdateVersion,
    String? forceUpdateVersionNo,
    bool? needForceUpdate,
    String? downloadURL,
    bool? buildHaveNewVersion,
    String? buildVersionNo,
    String? buildVersion,
    String? buildDescription,
    String? buildUpdateDescription,
    String? appURl,
    String? appKey,
    String? buildKey,
    String? buildName,
    String? buildIcon,
    String? buildFileKey,
    String? buildFileSize,
  }) {
    return CheckAppUpdateData()
      ..buildBuildVersion = buildBuildVersion ?? this.buildBuildVersion
      ..forceUpdateVersion = forceUpdateVersion ?? this.forceUpdateVersion
      ..forceUpdateVersionNo = forceUpdateVersionNo ?? this.forceUpdateVersionNo
      ..needForceUpdate = needForceUpdate ?? this.needForceUpdate
      ..downloadURL = downloadURL ?? this.downloadURL
      ..buildHaveNewVersion = buildHaveNewVersion ?? this.buildHaveNewVersion
      ..buildVersionNo = buildVersionNo ?? this.buildVersionNo
      ..buildVersion = buildVersion ?? this.buildVersion
      ..buildDescription = buildDescription ?? this.buildDescription
      ..buildUpdateDescription = buildUpdateDescription ??
          this.buildUpdateDescription
      ..appURl = appURl ?? this.appURl
      ..appKey = appKey ?? this.appKey
      ..buildKey = buildKey ?? this.buildKey
      ..buildName = buildName ?? this.buildName
      ..buildIcon = buildIcon ?? this.buildIcon
      ..buildFileKey = buildFileKey ?? this.buildFileKey
      ..buildFileSize = buildFileSize ?? this.buildFileSize;
  }
}